<nz-spin [nzSpinning]="isSpinning">
  <form nz-form [formGroup]="formModel">

    <div class="toolbar margin-bottom" [ngClass]="isMobile?'wrap-mobile':'wrap'">
      <div class="item" nz-col nzXs="24" nzSm="24" nzMd="12" nzLg="8" nzXl="11">

        <nz-form-item>
          <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="withdrawType" nzRequired>提现类型
          </nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请选择提现类型!">
            <nz-radio-group formControlName="withdrawType" [(ngModel)]="withdrawType">
<!--              <label nz-radio nzValue="1" (click)="clickWithdrawalsType(1)">余额提现 </label>-->
              <label nz-radio nzValue="2" (click)="clickWithdrawalsType(2)" *ngIf="roleId != roleIdEnum.MERCHANT">分润提现</label>
            </nz-radio-group>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="invoice" nzRequired>开发票</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请选择开发票类型!">
            <nz-input-group>
              <nz-radio-group formControlName="invoiceFlag">
                <label nz-radio nzValue="01" (click)="clickInvoiceFlag(1)">对私 </label>
                <label nz-radio nzValue="02" (click)="clickInvoiceFlag(2)">对公 </label>
              </nz-radio-group>
              <!--                  <button [hidden]="judgment" class="information" nz-button nzType="primary" (click)="showInvoice()">开票信息</button>-->
            </nz-input-group>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item>
          <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired>可用余额</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入可用余额!">
            <nz-input-group>
              <input formControlName="balance" nz-input placeholder="请输入可用余额" readonly
                     class="inputStryle"/>
            </nz-input-group>
          </nz-form-control>
        </nz-form-item>


        <nz-form-item>
          <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="website" nzRequired>提现金额</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入提现金额(不能超过两位小数)!" >
            <input nz-input formControlName="money" type="number" placeholder="提现金额" (ngModelChange)="checkMoney()"/>
            <!--                       (ngModelChange)="checkName()"/>-->
          </nz-form-control>
        </nz-form-item>


        <nz-form-item *ngIf="invoiceFlag =='01' ">
          <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired>扣税金额 ({{platformTax * 100}}%）</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24">
            <nz-input-group>
              <input formControlName="tax" nz-input readonly class="inputStryle"/>
              <span class="span" >代开发票需扣除提现金额{{platformTax * 100}}%</span>
            </nz-input-group>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item *ngIf="invoiceFlag =='01'">
          <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired>实际到账</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24">
            <nz-input-group>
              <input nz-input readonly formControlName="actualAccount" class="inputStryle"
              />
            </nz-input-group>
          </nz-form-control>
        </nz-form-item>


        <nz-form-item *ngIf="invoiceFlag=='02' ">
          <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired>扣税金额</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入扣税金额!">
            <input nz-input formControlName="tax" placeholder="扣税金额" readonly
                   class="inputStryle"/>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item [hidden]="invoiceFlag!='02'">
          <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired>发票金额</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入发票金额!">
            <input nz-input formControlName="invoiceMoney" placeholder="发票金额" readonly
                   class="inputStryle"/>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item [hidden]="invoiceFlag!='02'">
          <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired>开票日期:</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24">
            <nz-date-picker style="width: 100%"
                            formControlName="invoiceDate"
                            (ngModelChange)="onStartChange($event)"
                            nzPlaceHolder="开票日期"
                            nzFormat="yyyy-MM-dd">
            </nz-date-picker>
          </nz-form-control>
        </nz-form-item>


        <nz-form-item [hidden]="invoiceFlag!='02'">
          <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired>快递编号</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入快递编号!">
            <input nz-input onkeyup="this.value=this.value.replace(/^ +| +$/g,'')" formControlName="expressNo"
                   placeholder="快递编号"/>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item [hidden]="invoiceFlag!='02'">
          <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired>快递公司</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入快递公司!">
            <input nz-input onkeyup="this.value=this.value.replace(/^ +| +$/g,'')" formControlName="expressName"
                   placeholder="快递公司"/>
          </nz-form-control>
        </nz-form-item>
        <nz-form-item [hidden]="invoiceFlag!='02'">
          <nz-form-label [nzSpan]="8">发票上传</nz-form-label>
          <nz-form-control [nzSpan]="15" nzErrorTip="请输入角色名称！">
            <div>
              <div>
                <nz-upload
                  [nzTransformFile]="transformFile"
                  class="avatar-uploader"
                  nzName="image"
                  [nzAction]="uploadUrl"
                  [nzHeaders]="{ authorization: accessToken }"
                  nzListType="picture-card"
                  [nzPreview]="handlePreview"
                  [nzDownload]="nzDownload"
                  [nzRemove]="removeImg"
                  [nzShowButton]="invoicePhotoList.length < 8"
                  (nzChange)="handleChange($event)"
                >
                  <i nz-icon nzType="plus"></i>
                </nz-upload>
              </div>
            </div>
          </nz-form-control>
        </nz-form-item>

        <nz-form-item nz-row>
          <nz-form-control [nzSpan]="14" [nzOffset]="12">
            <button nz-button nzType="primary" (click)="submitForm()">提交</button>
          </nz-form-control>
        </nz-form-item>
      </div>

      <div class="bank-information" nz-col nzXs="24" nzSm="24" nzMd="12" nzLg="8" nzXl="6">
        <h3 class="receipt">收款账户</h3>
        <nz-form-item>
          <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="name">姓名</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入姓名!">
            {{bankCertName}}
          </nz-form-control>
        </nz-form-item>


        <nz-form-item>
          <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="bankName">银行名</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入银行名!">
            {{bankName}}
          </nz-form-control>
        </nz-form-item>


        <nz-form-item>
          <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="branchName">支行名</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入支行名!">
            {{branchName}}
          </nz-form-control>
        </nz-form-item>


        <nz-form-item>
          <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="bankCode">银行卡号</nz-form-label>
          <nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="请输入银行卡号'">
            {{bankCardNo}}
          </nz-form-control>
        </nz-form-item>
      </div>


    </div>
  </form>

  <!--    <div [hidden]="consequence" class="present">已经提交申请，请关闭界面，重新请求提现</div>-->
</nz-spin>
<!--<app-invoice-info [isVisible]="isVisibleInvoice" (event)="eventInvoice($event)"></app-invoice-info>-->
<!--<app-bind-bank-card [isVisible]="isVisiblebankcard" (event)="bindBankCardInfo($event)" [userId]="userInfo.id"-->
<!--                    [AcceptValue]="AcceptValue"></app-bind-bank-card>-->
<app-bind-bank-card [isVisible]="isVisible" [cardNoType]="cardNoType"
                    (emit)="emitBindBankCard($event)"></app-bind-bank-card>
